<template>
	<view class="address-wrap ">
		<image class="address-bg" src="https://cdn.quantifynet.cn/dti/bg_detail_top@2x.png"></image>
		<view class="address-info flex-row" @click="gotoRouter('/pages-client/member/addressList?type=1')">
			<image class="address-item-icon" src="https://cdn.quantifynet.cn/dti/address.png" mode=""></image>

			<view class="">
				<view v-if="userAddress" class="address-item-name nowrap">收货人：{{ userAddress.name }}&nbsp;&nbsp;{{ userAddress.mobile }}</view>
				<view v-if="userAddress" class="address-item-detail nowrap">
					收货地址：{{ userAddress.province != userAddress.city ? userAddress.province : '' }}{{ userAddress.city }}{{ userAddress.district }}{{ userAddress.address }}
				</view>
			</view>

			<view v-if="!userAddress" class="address-item-query">选择收货地址>></view>
		</view>
	</view>
</template>

<script>
import { mapState, mapMutations } from 'vuex';
export default {
	props: {
		value: {
			type: Number | String,
			default: 0
		},
		list: {
			type: Array,
			default() {
				return [];
			}
		}
	},
	computed: {
		...mapState({
			userAddress: state => state.userAddress
		})
	},
	data() {
		return {};
	},
	onLoad(option) {},
	onShow() {},
	methods: {
		...mapMutations({
			setUserAddress: 'setUserAddress'
		})
	}
};
</script>

<style lang="less">
.address-wrap {
	width: 750rpx;
	height: 184rpx;
	position: relative;
	.address-bg {
		width: 750rpx;
		height: 184rpx;
		position: absolute;
		top: 0;
		left: 0;
		z-index: 0;
	}

	.address-info {
		position: relative;
		z-index: 9;
		width: 750rpx;
		height: 184rpx;
		padding-left: 60rpx;
		box-sizing: border-box;
		align-items: center;
		.address-item-icon {
			width: 60rpx;
			height: 54rpx;
			margin-right: 25rpx;
		}

		.address-item-name {
			font-size: 28rpx;
			font-family: STSongti-SC-Bold, STSongti-SC;
			font-weight: 400;
			color: #987758;
		}
		.address-item-detail {
			width: 600rpx;
			font-size: 28rpx;
			font-family: STSongti-SC-Bold, STSongti-SC;
			font-weight: 400;
			color: #987758;

			margin-top: 10rpx;
		}
		.address-item-query {
			font-size: 32rpx;
			font-family: STSongti-SC-Bold, STSongti-SC;
			font-weight: bold;
			color: #987758;
		}
	}
}
</style>
